﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LunarSF.SHomeWorkshop.LunarMarkdownEditor
{
    /// <summary>
    /// 此类拟用于改造编译工作区功能（最好用后台线程）。
    /// 但由于风险太大，暂时还不敢动手。2024年4月3日
    /// </summary>
    public class HtmlCompileOptions : Dictionary<string, object>
    {
        public HtmlCompileOptions()
        {
            LoadCompileOptions();
        }

        private void LoadCompileOptions()
        {
            this.Add("ThemeText", Globals.MainWindow.ThemeText);
            this.Add("AutoNumberHeaders", Globals.MainWindow.AutoNumberHeaders);
            this.Add("AutoNumberHeaders", Globals.MainWindow.AutoNumberHeaders);
            this.Add("AutoNumberStyle", Globals.MainWindow.AutoNumberStyle);
            this.Add("CleanHeaders", Globals.MainWindow.CleanHeaders);
            this.Add("TryToCollapseCustomRegion", Globals.MainWindow.TryToCollapseCustomRegion);
            this.Add("CompileCodeToFillBlank", Globals.MainWindow.CompileCodeToFillBlank);
            this.Add("CompilePageMenu", Globals.MainWindow.CompilePageMenu);
            this.Add("HideExamAnswer", Globals.MainWindow.HideExamAnswer);
            this.Add("EnableBaseMDSyntax", Globals.MainWindow.EnableBaseMDSyntax);
            this.Add("EnableSetextHeaders", Globals.MainWindow.EnableSetextHeaders);
            this.Add("CreateLinksForTitles", Globals.MainWindow.CreateLinksForTitles);
            this.Add("SupportThreeSlashQuotersCodeBlock", Globals.MainWindow.SupportThreeSlashQuotersCodeBlock);
            this.Add("SupportDoubleColon", Globals.MainWindow.SupportDoubleColon);
            this.Add("SupportDoubleComma", Globals.MainWindow.SupportDoubleComma);
            this.Add("SupportDoublePeriod", Globals.MainWindow.SupportDoublePeriod);
            this.Add("SupportMultiQuestion", Globals.MainWindow.SupportMultiQuestion);
            this.Add("SupportMultiExclamation", Globals.MainWindow.SupportMultiExclamation);
            this.Add("AppendHeadLine", Globals.MainWindow.AppendHeadLine);
            this.Add("AppendFootLine", Globals.MainWindow.AppendFootLine);
            this.Add("AppendThemeSwitcher", Globals.MainWindow.AppendThemeSwitcher);
            this.Add("AutoCreateIndexHtmlFile", Globals.MainWindow.AutoCreateIndexHtmlFile);
            this.Add("EnableEasyUI", Globals.MainWindow.EnableEasyUI);
            this.Add("AppendTimeOfCompiling", Globals.MainWindow.AppendTimeOfCompiling);
            this.Add("CorrectImagePath", Globals.MainWindow.CorrectImagePath);
            this.Add("ImageTitleAtTop", Globals.MainWindow.ImageTitleAtTop);
            this.Add("ImageDefaultStyle", Globals.MainWindow.ImageDefaultStyle);
            this.Add("TableCaptionAtBottom", Globals.MainWindow.TableCaptionAtBottom);
            this.Add("FormatAfterCompile", Globals.MainWindow.FormatAfterCompile);
            this.Add("DefaultEncoding", Globals.MainWindow.DefaultEncoding);
            this.Add("DefaultIeVersion", Globals.MainWindow.DefaultIeVersion);
            this.Add("IgnoreAutoLinkTitles", Globals.MainWindow.IgnoreAutoLinkTitles);
            this.Add("AskNames", Globals.MainWindow.AskNames);
            this.Add("CompileAsTestPaper", Globals.MainWindow.CompileAsTestPaper);
            this.Add("CompileSimpleFillBlank", Globals.MainWindow.CompileSimpleFillBlank);
            this.Add("AnswerReceiverUrl", Globals.MainWindow.AnswerReceiverUrl);
            this.Add("RemoveScript", Globals.MainWindow.miRemoveScripts.IsChecked == true);
        }
    }

    /// <summary>
    /// 此类拟用于改造编译工作区功能（最好用后台线程）。
    /// 但由于风险太大，暂时还不敢动手。2024年4月3日
    /// </summary>
    public class WorkspaceCompileOptions : Dictionary<string, object>
    {
        public WorkspaceCompileOptions()
        {
            LoadCompileOptions();
        }

        private void LoadCompileOptions()
        {
            this.Add("IgnoreAbortedFiles", Globals.MainWindow.IgnoreAbortedFiles);
            this.Add("IgnoreEncryptedFiles", Globals.MainWindow.IgnoreEncryptedFiles);
        }
    }

    /// <summary>
    /// 此类拟用于改造编译工作区功能（最好用后台线程）。
    /// 但由于风险太大，暂时还不敢动手。2024年4月3日
    /// </summary>
    public class CHMCompileOptions : Dictionary<string, object>
    {
        public CHMCompileOptions()
        {
            LoadCompileOptions();
        }

        private void LoadCompileOptions()
        {
            this.Add("CollapseFirstSubLevel", Globals.MainWindow.CollapseFirstSubLevel);
            this.Add("ChmImageType", Globals.MainWindow.ChmImageType);
            this.Add("ChmNavBarVisible", Globals.MainWindow.ChmNavBarVisible);
            this.Add("ChmImportDirectoryPathes", Globals.MainWindow.ChmImportDirectoryPathes);
        }
    }
}
